Computer آرشيو وبلاگ نويسندگان جمعه 8 دی 1391برچسب:C#,learning Visual studio,آموزش برنامه نویسی , زبان سی شارپ,ویژوال استودیو, :: 10:59 :: نويسنده : مصطفی
ﻣﺒﺤﺚ : overloading ;(void myMethod(int p۱
;(void myMethod(int p۱, int p۲ ;(void myMethod(int p۱, string s۱
;using System
namespace ex۱۸ } class Class۱ } [[STAThread (static void Main(string[] args } ;()writeIT ;(۲۱)writeIT ;()Console.ReadLine { ()public static void writeIT } ;( ".Console.WriteLine(" writeIT() Ver { (public static void writeIT(int intI } ;( Console.WriteLine(" writeIT(intI) Ver. = " + intI { { {
ﻣﺒﺎﺣﺚ ﺗﻜﻤﯿﻠﻲ آراﻳﻪ ھﺎ (آراﻳﻪ ھﺎی ﭼﻨﺪ ﺑﻌﺪی): type [,] array-name
ﻣﺜﺎل : ﻳﻚ ﺑﺮﻧﺎﻣـﻪ ی ﺳـﻲ ﺷـﺎرپ ﺟﺪﻳـﺪ console را در VS.NETﺑـﺎز ﻛﻨﯿـﺪ و ﻧـﺎم آﻧـﺮا دراﺑﺘـﺪا ex۱۹اﻧﺘﺨـﺎب ﻧﻤﺎﻳﯿـﺪ. ;using System
namespace ex۱۹ } class Class۱ { [STAThread] static void Main(string[] args) { const int rows = ۴; const int columns = ۳; // declare a ۴x۳ integer array int[,] rectangularArray = new int[rows, columns]; // populate the array for (int i = ۰;i < rows;i++) { for (int j = ۰;j rectangularArray[i,j] = i+j; } } // report the contents of the array for (int i = ۰;i < rows;i++) { for (int j = ۰;j Console.WriteLine("rectangularArray[{۰},{۱}] = {۲}", i,j,rectangularArray[i,j]); } } Console.ReadLine(); } } }
: ﺗﻮﺿﯿﺤﺎﺗﻲ در ﻣﻮرد ﻛﺪ ﻓﻮق new int[rows, columns] : اﺳﺘﻔﺎده از آراﻳﻪ ھﺎی ﭼﻨﺪ ﺑﻌﺪی
. اﻧﺘﺨـﺎب ﻧﻤﺎﻳﯿـﺪex۲۰ ﺑـﺎز ﻛﻨﯿـﺪ و ﻧـﺎم آﻧـﺮا دراﺑﺘـﺪاVS.NET را در console ﻣﺜﺎل : ﻳﻚ ﺑﺮﻧﺎﻣـﻪ ی ﺳـﻲ ﺷـﺎرپ ﺟﺪﻳـﺪ
ﺳﭙﺲ ﻛﺪ زﻳﺮ را درون آن ﺑﻨﻮﻳﺴﯿﺪ : using System;
namespace ex۲۰ { class Class۱ { [STAThread] static void Main( string[] args ) { const int rows = ۴; const int columns = ۳; // imply a ۴x۳ array int[,] rectangularArray = { {۰,۱,۲}, ,{۵,۴,۳} ,{۸,۷,۶} {۱۱,۰۱,۹} ;{ (++for (int i = ۰;i < rows;i } (++for (int j = ۰;j ,"{۲} = [{۱},{۰}]Console.WriteLine("rectangularArray ;([i,j,rectangularArray[i,j { { { { {
خب به پایان این دوره آموزشی که یک دوره مقدماتی برای آموزش سی شارپ بود رسیدیم. انشاءالله که در دوره های بعدی بتونم که برای شما عزیزان آموزش های مفیدتر و پیشرفته تری رو آماده کنم در انتها از مدیریت سایت vcsharp.ir نیز تشکر می نمایم.
منبع : برگرفته از سایت VCsharp.ir نظرات شما عزیزان: پيوندها
|
|||||||||||||||||
![]() |